@extends('backend::config.set_tab')
@section('title',$page_title)
@section('rule-content')
    @component('backend::component.form.form')
        @slot('page_title') {{$page_title}} @endslot
        @slot('formId') rule @endslot
        @slot('action') {{url()->current()}} @endslot

        <div class="form-group">
            <div class="rule-column">
                <div class="rule-title"><span>充值规则</span></div>
                <div class="rule-content">
                    <p>
                        <span> {{get_currency()['money2']}}最小充值金额</span>
                        <input type="text" name="rg_min"
                               value="{{$rule->rg_min ?? 0}}"
                               class="form-control d-inline ipt-md" >
                        <span> 元且必须是</span>
                        <input type="text" name="rg_mul"
                               value="{{$rule->rg_mul ?? 0}}"
                               class="form-control d-inline ipt-md" >
                        <span> 的整数倍 充值服务费</span>
                        <input type="text" name="rg_tax"
                               value="{{$rule->rg_tax ?? 0}}"
                               class="form-control d-inline ipt-md" >%
                    </p>

                </div>
            </div>

        </div>

        <div class="form-group">
            <div class="rule-column">
                <div class="rule-title"><span>提现规则</span></div>
                <div class="rule-content">
                    <p>
                        <span> {{get_currency()['money2']}}最小提现金额</span>
                        <input type="text" name="wd_min"
                               value="{{$rule->wd_min ?? 0}}"
                               class="form-control d-inline ipt-md" >
                        <span> 元最大金额</span>
                        <input type="text" name="wd_max"
                               value="{{$rule->wd_max ?? 0}}"
                               class="form-control d-inline ipt-md" >
                        <span> 元且必须是</span>
                        <input type="text" name="wd_mul"
                               value="{{$rule->wd_mul ?? 0}}"
                               class="form-control d-inline ipt-md" >的整数倍
                        <span> 手续费</span>
                        <input type="text" name="wd_tax"
                               value="{{$rule->wd_tax ?? 0}}"
                               class="form-control d-inline ipt-md" >
                        <span> %</span>

                    </p>
                  <p>
                      <span> 提现时间为每天</span>
                      <input type="text" name="wd_time"
                             value="{{$rule->wd_time ?? 0}}"
                             class="form-control d-inline ipt-md" >
                  </p>
                </div>
            </div>

        </div>

        <div class="form-group">
            <div class="rule-column">
                <div class="rule-title"><span>转账转换</span></div>
                <div class="rule-content">

                    <p>
                        <span> 每次转账转换最低</span>
                        <input type="text" name="tf_min"
                               value="{{$rule->tf_min ?? 0}}"
                               class="form-control d-inline ipt-md" >
                        <span> 元最大金额</span>
                        <input type="text" name="tf_max"
                               value="{{$rule->tf_max ?? 0}}"
                               class="form-control d-inline ipt-md" >
                        <span> 元且必须是</span>
                        <input type="text" name="tf_mul"
                               value="{{$rule->tf_mul ?? 0}}"
                               class="form-control d-inline ipt-md" >
                        <span> 的整数倍</span>
                    </p>

                    <p>
                        <span> 转换比例</span>
                        <input type="text" name="tf_self_tax"
                               value="{{$rule->tf_self_tax ?? 0}}"
                               class="form-control d-inline ipt-md" >
                        <span>  转账手续费</span>
                        <input type="text" name="tf_tax"
                               value="{{$rule->tf_tax ?? 0}}"
                               class="form-control d-inline ipt-md" >
                        <span> %</span>
                    </p>

                </div>
            </div>

        </div>

        @slot('buttons')
            @component('backend::component.form.button')
                @slot('title') 提交 @endslot
                @slot('size') sm @endslot
                @slot('color') danger @endslot
                @slot('attr') style=margin-left:150px; @endslot
                @slot('params') {"formId":"#rule"} @endslot
                @slot('class') btn-min-width ajax-form @endslot
            @endcomponent
        @endslot
    @endcomponent
@endsection
@push('scripts')
    <script>
        layui.use(['jquery','layer','laydate'], function(){
            var $ = layui.jquery;
            var layer = layui.layer;
            var laydate = layui.laydate;
            $('.range-time').each(function () {
                var targetElem = $(this);
                var defaultVal = $(this).val();
                laydate.render({
                    elem:targetElem[0]
                    ,type: 'time'
                    ,value:defaultVal
                    ,range: true //或 range: '~' 来自定义分割字符
                });
            })
        });
    </script>
@endpush